package com.xc58.highreactor.exception;

public class ByteArrayCastToObjectException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private static String EXCEPTION_FORMAT = "the except size %d, but actually is %d";
	
	public ByteArrayCastToObjectException(int except, int actually){
		super(String.format(EXCEPTION_FORMAT, except,actually));
	}
	
	public static ByteArrayCastToObjectException cast2IntException(int actually){
		return new ByteArrayCastToObjectException(4, actually);
	}
	

}
